home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / unixlib.lha / unix / src / utime.c < prev    next >
C/C++ Source or Header  |  1996-01-04  |  403b  |  27 lines

  1. #include "amiga.h"
  2. #include "timeconvert.h"
  3. #include <stdlib.h>
  4. #include <time.h>
  5. #include <utime.h>
  6.  
  7. int utime(char *file, struct utimbuf *times)
  8. {
  9.     struct DateStamp date;
  10.     time_t mtime;
  11.  
  12.     __chkabort();
  13.     if (times)
  14.     mtime = times->modtime;
  15.     else
  16.     mtime = time(0);
  17.  
  18.     if (mtime == -1)
  19.     return 0;
  20.  
  21.     _gmt2amiga(mtime, &date);
  22.  
  23.     if (SetFileDate(file, &date))
  24.     return 0;
  25.     ERROR;
  26. }
  27.